package com.example.demo;

/**
 * @Author lizhien (zhien.li@nascent.cn)
 * @Date 2020/8/4 19:47
 * @Version 1.0.0
 * @Description com.example.demo
 */

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.jms.annotation.EnableJms;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@EnableJms    //启动消息队列
@RestController
@Slf4j
public class ActivemqClientApplication {

    public static void main(String[] args) {
        SpringApplication.run(ActivemqClientApplication.class, args);
    }

    @GetMapping("/")
    public String index(@RequestParam(value = "msg", defaultValue = "hello activemq") String msg) {
        return msg;
    }

    @GetMapping("/test")
    public R<String> test() {
        log.debug("输出DEBUG级别日志");
        log.info("输出INFO级别日志");
        log.warn("输出WARN级别日志");
        log.error("输出ERROR级别日志");
        return R.ok("test", "success");
    }
}
